import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import Home from '../views/Home.vue'
import Layout from '../views/layout.vue'
import Search from '../views/search.vue'
import  Shopping from'../views/Shopping.vue'
import  Contact from'../views/Contact.vue'
import  Myxinwen from'../views/post/Myxinwen.vue'
import  Mytupian from'../views/post/Mytupian.vue'
import  Myshangpin from'../views/post/Myshangpin.vue'
import  MyNewsDetial from'../views/post/MyNewsDetial.vue'
import  Mytupianxiang from'../views/post/Mytupianxiang.vue'
import  Myspxiangqing from'../views/post/Myspxiangqing.vue'
import  Mytuwenjies from'../views/post/Mytuwenjies.vue'
import  Mypinglun from'../views/post/Mypinglun.vue'

const routes = [
  { path: '/', redirect: '/layout' },
  { path: '/layout', component: Layout,redirect: '/layout/home',
  children: [
      { path: 'home', component: Home, meta: { title: '首页' } },
      { path: 'search', component: Search, meta: { title: '搜索' } },
      { path: 'shopping', component: Shopping, meta: { title: '购物车' } },
      { path: 'contact', component: Contact, meta: { title: '会员' } },
      { path: 'myxinwen', component: Myxinwen },
{ path: 'mytupian', component: Mytupian },
{ path: 'myshangpin', component: Myshangpin },
{ path: 'myNewsDetial/:id', component: MyNewsDetial },
{ path: 'mytupianxiang/:id', component: Mytupianxiang },
{ path: 'myspxiangqing/:id', component: Myspxiangqing },
{ path: 'mytuwenjies/:id', component: Mytuwenjies },
{ path: 'mypinglun/:id', component: Mypinglun },
    ],

},


 
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
